unit UCtrlCor;

interface

    uses
        db, UController,UDaoCor;
    type
        CtrlCor = class (Controller)

protected
   umaDaoCor : daocor;

public
    constructor Create;
    destructor Destroy;
    function Salvar (obj : TObject) : string;     override;
    function getDs : TDataSource;                 override;
    function Carrega (obj : Tobject) : Tobject ;  override;
    function Excluir (obj : Tobject) : String ;   override;
    function Buscar (chave : string) : boolean ;  override;
    function Editar (obj: Tobject)   : string;    override;
    function existe(dado:string):Boolean; override;
end;

implementation

{ CtrlPais }

function CtrlCor.Buscar(chave: string): boolean;
begin
    Result := umaDaoCor.Buscar(chave);
end;

function CtrlCor.Carrega(obj: Tobject): Tobject;
begin
    Result := umaDaoCor.Carrega(obj);
end;

constructor CtrlCor.Create;
begin
    inherited;
    umadaocor:= daocor.Create;
end;

destructor CtrlCor.Destroy;
begin
    inherited;
end;


function CtrlCor.Editar(obj: Tobject): string;
begin

end;

function CtrlCor.Excluir(obj: Tobject): String;
begin

end;

function CtrlCor.existe(dado: string): Boolean;
begin

end;

function CtrlCor.getDs: TDataSource;
begin
    result:= umaDaoCor.GetDS;
end;

function CtrlCor.Salvar(obj: TObject): string;
begin
    result:= umaDaoCor.salvar(obj);
end;

end.

